package com.xzh.testDemo.service.impl;

import com.xzh.spring.AutoWired;
import com.xzh.spring.BeanNameAware;
import com.xzh.spring.Component;
import com.xzh.spring.InitializeBean;
import com.xzh.testDemo.service.OrderService;
import com.xzh.testDemo.service.User;
import com.xzh.testDemo.service.UserService;

@Component("userService")
public class UserServiceImpl implements UserService, BeanNameAware {

//    @AutoWired
//    private User user;

    private String beanName;

    @AutoWired
    private OrderService orderService;

    @Override
    public void test() {
//        System.out.println(user);
        System.out.println("userService 的 test()");
        orderService.test();
    }

    @Override
    public void runOtherClass() {
        System.out.println(orderService);
    }

    @Override
    public void setName(String name) {
        beanName = name;
    }

//    @Override
//    public void afterPropertiesSet() {
//        System.out.println(beanName + "被初始化了！");
//    }
}
